package com.example.qjssoandroid;

import android.os.Bundle;
import android.util.Log;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {
    static {
        System.loadLibrary("native-lib");
    }

    // 声明本地方法
    public native String initializeQuickJS(String jsCode);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        String jsCode = "const hello = 'Hello, QuickJS!'; hello;";
        String result = initializeQuickJS(jsCode);
        //initializeQuickJS(jsCode);

        Log.d("QuickJS", "Result: " + result);
    }
}